package com.mjkj.demo.mapper;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mjkj.demo.model.entity.Users;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Xudoom
 * @since 2023-10-16
 */
public interface UserMapper extends BaseMapper<Users> {

    /**
     * 按用户名选择
     *
     * @param username 用户名
     * @return {@code Users}
     */
    default Users selectByUsername(String username) {
        return selectOne(new LambdaQueryWrapper<Users>().eq(Users::getUsername, username));
    }
}
